import axios from "axios";

var url = "http://localhost:8080/abc";
url = "http://47.103.36.143:3000";
// 创建axios实例
const service = axios.create({
  //baseURL: url, // api的base_url
  timeout: 30000, // 请求超时时间 30000
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded'
    // 'Content-Type': 'application/json'
  }
});

export function getDbList() {
  return axios({
    url: url + "/api/dbList",
    method: "get"
  });
}

export function getTableList() {
  return axios({
    url: url + "/api/tableList",
    method: "get",
    params: {
      table_schema: 'community'
    }
  });
}

export function getTableColumList(params) {
  var config = {
    table_schema: 'community'
  };

  params = Object.assign({}, config, params);
  return axios({
    url: url + "/api/tableColumList",
    method: "get",
    params: params
  });
}
